// 一、将下面异步代码使用Promise的方式改进
setTimeout(function () {
  var a = 'hello'
  setTimeout(function () {
    var b = 'lagou'
    setTimeout(function () {
      var c = 'I ❤ U'
      console.log(a + b + c)
    }, 10)
  }, 10)
}, 10)


function timer (str1, str2) {
  return new Promise(function (resolve) {
    setTimeout(function () {
      resolve(str1 + str2)
    }, 10)
  })
}

let a = 'hello'
let b = 'lagou'
timer(a, b).then(function(str) {
  let c = 'I ❤ U'
  return timer(str, c)
}).then(function (str) {
  console.log(str)
})